/*
 * @Author: weisheng
 * @Date: 2023-04-17 12:51:22
 * @LastEditTime: 2023-04-20 15:01:53
 * @LastEditors: weisheng
 * @Description:
 * @FilePath: \uniapp-vue3-fant-ts\src\api\DemoApi.ts
 * 记得注释
 */
import http from '@/http/HttpClient'
import BaseResponse from '@/model/BaseResponse'
import Chanel from '@/model/Chanel'
import UserInfo from '@/model/UserInfo'
import { getParams } from '@/utils/common'
// 这里将API方法统一管理
export default class DemoApi {
  static login111(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/open/v2/login_check', data, {})
      .then((res) => {
        return res.data
      })
  }
  static getDistsList(url, data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post(url, data, {})
      .then((res) => {
        return res.data
      })
  }
  // 已申请，已失效，已引用
  static getDistsListOther(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post('/cityAdmin/mall/goods/dist/v2/apply_list', data, {})
      .then((res) => {
        return res.data
      })
  }
  static sendApply(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post('/cityAdmin/mall/goods/dist/v2/apply', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 批量
  static plSendApply(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post('/cityAdmin/mall/goods/dist/v2/apply_batch', data, {})
      .then((res) => {
        return res.data
      })
  }

  static delStore(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/dist/v2/del${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 分销下单接口
  static downStoreApply(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/goods/submit_for_mall_distribution', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 获取微信支付
  static getpPaySignWx(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/v1/pay_sign_wx${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 拒绝同意接口
  static agreeOrRejAjax(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/goods/dist/v2/consent_batch', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 单独的接口拒绝同意接口
  static agreeOrRejCommon(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .put(`/cityAdmin/mall/goods/dist/v2/consent${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static getpDistUser(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/dist/v2/dist_user${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static stopDistGoods(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/dist/v2/stop${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static setStoreShelf(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/dist/v2/shelf${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 获取我的分销订单
  static getMyDistsOrder(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post(`/cityAdmin/admin/order_mall_dist/v2/list_data`, data, {})
      .then((res) => {
        return res.data
      })
  }

  static getRefundReason(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/v2/refund_reason${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static setCancelRefund(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/v2/cancel_refund${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static loopCheck(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/v1/order_info${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  static setConfirmReceipt(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/goods/v2/confirm${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  //  申请退款
  static submitYourRefundInformation(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .post(`/cityAdmin/mall/goods/v2/after_sale`, data, {})
      .then((res) => {
        return res.data
      })
  }
}
